//
//  NewsTableViewCell.m
//  10--UITableViewCell自适应高度
//
//  Created by 冀永金 on 16/7/27.
//  Copyright © 2016年 冀永金. All rights reserved.
//

#import "NewsTableViewCell.h"

@interface NewsTableViewCell ()

@property (nonatomic, strong) UILabel *newsLabel;

@end
@implementation NewsTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.newsLabel = [[UILabel alloc]init];
        [self.contentView addSubview:_newsLabel];
        _newsLabel.numberOfLines = 0;
    }
    return self;
}
- (void)layoutSubviews {
    [super layoutSubviews];
//    NSLog(@"%lf",self.contentView.frame.size.height);
//    NSLog(@"%lf",self.frame.size.height);
    self.newsLabel.frame = CGRectMake(0, 0, self.contentView.frame.size.width, self.contentView.frame.size.height);
}

- (void)setString:(NSString *)string {
    
    _newsLabel.text = string;
}



- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
